package com.shady.diskmanger.model;

import java.io.Serializable;
import java.util.Objects;

public class SmallFile implements Serializable {
    private String name;
    private String path;
    private long size;
    private String md5;
    private String parentPath;

    @Override
    public String toString() {
        return name + "\t\t\t" + size + "\t\t\t" + parentPath + '\n';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SmallFile smallFile = (SmallFile) o;
        return Objects.equals(name, smallFile.name) && Objects.equals(md5, smallFile.md5);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, md5);
    }

    public String getParentPath() {
        return parentPath;
    }

    public void setParentPath(String parentPath) {
        this.parentPath = parentPath;
    }

    public SmallFile(String name, String path, long size, String md5, String parentPath) {
        this.name = name;
        this.path = path;
        this.size = size;
        this.md5 = md5;
        this.parentPath = parentPath;
    }

    public SmallFile() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public long getSize() {
        return size;
    }

    public void setSize(long size) {
        this.size = size;
    }

    public String getMd5() {
        return md5;
    }

    public void setMd5(String md5) {
        this.md5 = md5;
    }
}
